<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性伸缩比</title>
    <style>
        .box {
            /* 主轴尺寸默认由内容撑开，侧轴默认拉伸 */
            display: flex;
            flex-direction: column;
            width: 500px;
            height: 300px;
            border: 1px solid #000;;
        }
        .box div {
            background-color: pink;
        }
        .box div:nth-child(1) {
            width: 200px;
        }
        /* flex是指将父级剩余尺寸分成的份数例如这里第二个div标签占剩余三分之一 */
        .box div:nth-child(2) {
            flex: 1;
        }
        .box div:nth-child(3) {
            flex: 2;
        }
    </style>
</head>
<body>
    <div class="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
    </div>
</body>
</html>